package org.yiqixue.accounts.service;

import org.yiqixue.accounts.entity.Transaction;
import java.util.Date;
import java.util.List;

public interface TransactionService {
    List<Transaction> findByAccountNumberAndType(Long accountNumber, String type, Date date);
}

package org.yiqixue.accounts.service.impl;

import org.yiqixue.accounts.entity.Transaction;
import org.yiqixue.accounts.repository.TransactionRepository;
import org.yiqixue.accounts.service.TransactionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;

@Service
public class TransactionServiceImpl implements TransactionService {

    @Autowired
    private TransactionRepository transactionRepository;

    @Override
    public List<Transaction> findByAccountNumberAndType(Long accountNumber, String type, Date date) {
        return transactionRepository.findByAccountNumberAndTypeAndTransactionDate(accountNumber, type, date);
    }
}